<ion-view class="bg">
  <ion-header-bar class="bar bar-positive">
    <button class="button back-button buttons icon ion-ios-arrow-left button-clear" nav-direction="back" ui-sref="tab.workbench">返回</button>
    <h3 class="title">受理开单</h3>
    <button class="button button-icon icon ion-ios-search" ui-sref="myOrder({htmlId:'addWaybill'})"></button>
  </ion-header-bar>
  <ion-content>
      <div class="list card">
          <label class="item item-input div">
              <i class="input-label col-25" >承运日期</i>
              <button class="button button-block date button-clear" ng-click="showDate()" style="color: black;">{{WAYBILL_DATE | date : "yyyy年MM月dd日"}}</button>
          </label>
          <label class="item item-input item-select div">
              <i class="input-label col-25" >到达站</i>
              <select id="site">
                <option ng-repeat="i in sites" value="{{i.DEPT_ID}}">{{i.NAME}}</option>
              </select>
          </label>
          <label class="item item-input div">
            <i class="input-label col-25" >目的地</i>
            <input type="text"  ng-model="transWaybill.waybill.DESTINATION_STATION">
          </label>
          <div class="item item-input item-divider div">
              <img src="img/shr_logo.png" class="typeIcon" style="height: 25px;">
              <i class="dark">收货人</i>
              <i class="ion ion-ios-paper-outline chooseIcon"></i>
          </div>
          <div class="item item-input div">
              <i class="icon ion-asterisk assertive required"></i>
              <input type="text" class="col-50" ng-model="transWaybill.customers.R_CUSTOMER_NAME" readonly>
              <i class="icon ion-asterisk assertive required"></i>
              <input type="tel" class="col-50" ng-model="transWaybill.customers.R_CUSTOMER_PHONE" readonly>
          </div>
          <label class="item item-input div">
              <input type="text" placeholder="地址" maxlength="30" ng-model="transWaybill.customers.R_CUSTOMER_ADDRESS" readonly>
          </label>
          <div class="item item-input item-divider div">
              <img src="img/fhr_logo.png" class="typeIcon" style="height: 25px;">
              <i class="dark">发货人</i>
              <i class="ion ion-ios-paper-outline chooseIcon"></i>
          </div>
          <div class="item item-input div">
              <i class="icon ion-asterisk assertive required"></i>
              <input type="text" class="col-50" ng-model="transWaybill.customers.S_CUSTOMER_NAME" readonly>
              <i class="icon ion-asterisk assertive required"></i>
              <input type="tel"  class="col-50" ng-model="transWaybill.customers.S_CUSTOMER_PHONE" readonly>
          </div>
          <label class="item item-input div">
              <input type="text" ng-model="transWaybill.customers.S_CUSTOMER_ADDRESS" readonly>
          </label>
          <div class="item item-input item-divider div">
              <img src="img/fhxx_logo.png" class="typeIcon" style="height: 25px;">
              <i class="dark">发货信息</i>
          </div>
          <div class="item item-input div">
            <input type="text" class="col-50" ng-model="transWaybill.goods[0].GOODS_NAME" readonly>
            <input type="number" class="col-50" ng-model="transWaybill.goods[0].PIECES" style="margin-left: 32px;" readonly>
            <span class="company">件</span>
          </div>
          <div class="item item-input div">
            <input type="text" class="col-50" ng-model="transWaybill.goods[0].WEIGHT" readonly>
            <span class="company">吨</span>
            <input type="number" class="col-50" ng-model="transWaybill.goods[0].VOLUME" readonly>
            <span class="company">㎥</span>
          </div>
          <label class="item item-input div" ng-if="transWaybill.goods[0].SPOT_PAYMENT!=undefined">
            <i class="input-label col-25" >包装</i>
            <input type="text" ng-model="transWaybill.goods[0].SPOT_PAYMENT" readonly>
          </label>
          <div class="item item-input div" ng-if="DELIVERY_TYPE!=undefined">
            <i class="input-label col-25">送货方式</i>
            <i>{{DELIVERY_TYPE}}</i>
          </div>
          <div class="item item-input item-divider div">
            <img src="img/fy_logo.png" class="typeIcon" style="height: 25px;">
            <i class="dark">费用</i>
            <i class="ion ion-ios-paper-outline chooseIcon ion-plus-round"></i>
          </div>
          <div class="item item-input div" ng-if="DELIVERY_TYPE!=undefined">
            <i class="input-label col-25">付款方式</i>
            <i>多笔付</i>
          </div>
          <label class="item item-input div isDisplay">
            <i class="input-label col-25" >总运费</i>
            <input type="text" ng-model="transWaybill.costMap.FREIGHT_AMOUNT" readonly>
          </label>
          <label class="item item-input div isDisplay" ng-if="transWaybill.paymentMap.SPOT_PAYMENT!=undefined">
            <i class="input-label col-25" >现付</i>
            <input type="text" ng-model="transWaybill.paymentMap.SPOT_PAYMENT" readonly>
          </label>
          <label class="item item-input div isDisplay" ng-if="transWaybill.paymentMap.TO_PAYMENT!=undefined">
            <i class="input-label col-25" >到付</i>
            <input type="text" ng-model="transWaybill.paymentMap.TO_PAYMENT" readonly>
          </label>
          <label class="item item-input div isDisplay" ng-if="transWaybill.paymentMap.BACK_PAY!=undefined">
            <i class="input-label col-25" >欠付</i>
            <input type="text" ng-model="transWaybill.paymentMap.BACK_PAY" readonly>
          </label>
          <!--<label class="item item-input div isDisplay" ng-if="transWaybill.paymentMap.BACK_TO_PAY!=undefined">-->
            <!--<i class="input-label col-25" >回付</i>-->
            <!--<input type="text" ng-model="transWaybill.paymentMap.BACK_TO_PAY" readonly>-->
          <!--</label>-->
          <label class="item item-input div isDisplay" ng-if="transWaybill.paymentMap.MONTHLY_BALANCE!=undefined">
            <i class="input-label col-25" >月结</i>
            <input type="text" ng-model="transWaybill.paymentMap.MONTHLY_BALANCE" readonly>
          </label>
          <label class="item item-input div isDisplay" ng-if="transWaybill.paymentMap.GOODS_TO_CLOCK!=undefined">
            <i class="input-label col-25" >货到打卡</i>
            <input type="text" ng-model="transWaybill.paymentMap.GOODS_TO_CLOCK" readonly>
          </label>
          <label class="item item-input div isDisplay" ng-if="transWaybill.paymentMap.WITHHOLD!=undefined">
            <i class="input-label col-25" >代扣</i>
            <input type="text" ng-model="transWaybill.paymentMap.WITHHOLD" readonly>
          </label>
          <div class="item item-input div" ng-if="transWaybill.costMap.DELIVERY_FEE!=undefined&&transWaybill.costMap.DELIVERY_COST!=undefined">
            <i class="input-label col-25">提货费</i>
            <input type="text" ng-model="transWaybill.costMap.DELIVERY_FEE" style="padding-right: 0px;" readonly>
            <i class="input-label col-20">送货费</i>
            <input type="text" ng-model="transWaybill.costMap.DELIVERY_COST" style="padding-right: 0px;" readonly>
          </div>
          <div class="item item-input div" ng-if="transWaybill.costMap.DECLARE_VALUE!=undefined">
            <i class="input-label col-25" >声明价值</i>
            <input type="text" ng-model="transWaybill.costMap.DECLARE_VALUE" style="padding-right: 0px;" readonly>
            <i class="input-label col-20" >保费</i>
            <input type="text" ng-model="transWaybill.costMap.PREMIUM" style="padding-right: 0px;" readonly>
          </div>
          <div class="item item-input div" ng-if="transWaybill.paymentMap.BACK_NOW!=undefined&&transWaybill.paymentMap.OWE_TO_RETURN!=undefined">
            <i class="input-label col-25" >现返</i>
            <input type="text" ng-model="transWaybill.paymentMap.BACK_NOW" style="padding-right: 0px;" readonly>
            <i class="input-label col-20" >欠返</i>
            <input type="text" ng-model="transWaybill.paymentMap.OWE_TO_RETURN" style="padding-right: 0px;" readonly>
          </div>
          <label class="item item-input div" ng-if="transWaybill.costMap.PAYMENT_FREIGHT!=undefined">
            <i class="input-label col-25" >运费垫付</i>
            <input type="text" ng-model="transWaybill.costMap.PAYMENT_FREIGHT" readonly>
          </label>
          <label class="item item-input div" ng-if="transWaybill.costMap.AGENCY_FUND!=undefined">
            <i class="input-label col-25" >代收款</i>
            <input type="text" ng-model="transWaybill.costMap.AGENCY_FUND" readonly>
          </label>
          <label class="item item-input div" ng-if="transWaybill.costMap.PAY_COLLECTION!=undefined">
            <i class="input-label col-25" >代收款垫付</i>
            <input type="text" ng-model="transWaybill.costMap.PAY_COLLECTION" readonly>
          </label>
          <label class="item item-input div" ng-if="transWaybill.waybill.RECEIPT_NUM!=undefined">
            <i class="input-label col-25" >回单份数</i>
            <input type="text" ng-model="transWaybill.waybill.RECEIPT_NUM" readonly>
          </label>
          <label class="item item-input item-select div">
            <i class="icon ion-asterisk assertive required"></i>
            <i class="input-label col-25" >业务员</i>
            <select id="userDept">
              <option ng-repeat="i in userDepts" value="{{i.CNO}}">{{i.CNAME}}</option>
            </select>
          </label>
          <div class="item item-input">
            <textarea type="text" placeholder="备注" maxlength="30" ng-model="REMARK" style="height: 80px;"></textarea>
          </div>
      </div>
  </ion-content>
  <ion-footer-bar>
      <a class="button button-positive save" id="save" ng-click="saveTransWaybill()">保存</a>
      <a class="button button-positive print" id="print" ng-click="printTransWaybill($event)">打印</a>
  </ion-footer-bar>
</ion-view>
